package org.stars.dao.exception;

import org.stars.dao.sqlmapper.SqlMapper;

import static org.stars.config.Message.DUPLICATE_ID_FOUND_ERROR;

public class DuplicateIdFoundException extends Exception {

	private static final long serialVersionUID = -5494883913635696106L;
	
	protected SqlMapper sqlMapper;
	protected String key;
	
	public DuplicateIdFoundException(SqlMapper sqlMapper, String key)
	{
		this.sqlMapper=sqlMapper;
		this.key=key;
	}

	@Override
	public String getMessage() {
		return DUPLICATE_ID_FOUND_ERROR.with(key,sqlMapper.getId());
	}
	
	
	
	

}
